﻿using Abp.AutoMapper;
using Batman.Cms.Domains;
using Microsoft.AspNetCore.Mvc;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;

namespace Batman.Cms.Controllers.Inputs
{
    [AutoMap(typeof(Article))]
    public class CreateArticleInput
    {
        [Required(ErrorMessage = "请输入标题")]
        [Display(Name = "文章标题")]
        [MaxLength(255)]
        public string Title { get; set; }

        [Display(Name = "简介")]
        [MaxLength(255)]
        public string Summary { get; set; }

        [Required(ErrorMessage = "请选择文章分类")]
        [Display(Name = "文章分类")]
        [UIHint("ArticleTypeTree")]
        public int ArticleTypeId { get; set; }

        [UIHint("PictureUpload")]
        [Display(Name = "封面")]
        [MaxLength(255)]
        public string ImageUrl { get; set; }

        [UIHint("PictureUpload")]
        [Display(Name = "缩略图")]
        [MaxLength(255)]
        public string ImageThumbUrl { get; set; }

        [Display(Name = "文章正文")]
        [UIHint("TinyMce")]
        public string ArticleContent { get; set; }

        [Display(Name = "SEO关键字")]
        [MaxLength(255)]
        public string MetaKeyWords { get; set; }

        [Display(Name = "SEO描述")]
        [UIHint("TextArea")]
        [MaxLength(255)]
        public string MetaDescription { get; set; }

        [HiddenInput(DisplayValue = false)]
        [Display(Name = "")]
        public int Counter { get; set; }

        [HiddenInput(DisplayValue = false)]
        [Display(Name = "")]
        public int Status { get; set; }

        [Display(Name = "是否发布")]
        public bool IsPublished { get; set; }
    }
}
